package com.tang.algorithm.binaryserch;

/**
 * @author tlm
 * @version 1.0
 * @date 2020/7/5 21:04
 */
public class LeetCode852 {
    public int peakIndexInMountainArray(int[] A) {
        int left = 0, right = A.length - 1;
        while (left < right) {
            int mid = (left + right) >>> 1;
            if (A[mid] < A[mid + 1]) {
                left = mid + 1;
            } else {
                right = mid;
            }
        }
        return left;
    }
}
